﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model.Db.System;


namespace HengTong.ViewModel._Admin.SysCodeHistoryVms
{
    public partial class SysCodeHistoryTemplateVm : BaseTemplateVM
    {
        [Display(Name = "编码规则")]
        public ExcelPropety CodeRuleExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.CodeRuleId);
        [Display(Name = "生成编码")]
        public ExcelPropety GeneratedCodeExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.GeneratedCode);
        [Display(Name = "业务类型")]
        public ExcelPropety BusinessTypeExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.BusinessType);
        [Display(Name = "序号值")]
        public ExcelPropety SerialNumberExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.SerialNumber);
        [Display(Name = "生成时间")]
        public ExcelPropety GenerateTimeExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.GenerateTime);
        [Display(Name = "操作人")]
        public ExcelPropety OperatorExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.Operator);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.Remark);
        [Display(Name = "租户代码")]
        public ExcelPropety TenantCodeExcel = ExcelPropety.CreateProperty<SysCodeHistory>(x => x.TenantCode);

	    protected override void InitVM()
        {
            CodeRuleExcel.DataType = ColumnDataType.ComboBox;
            CodeRuleExcel.ListItems = DC.Set<SysCodeRule>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysCodeHistoryImportVm : BaseImportVM<SysCodeHistoryTemplateVm, SysCodeHistory>
    {

    }

}
